local ticket = redis.call('LPOP', KEYS[1])  -- 从列表左侧弹出一张票
if ticket then
    return ticket  -- 返回票的编号
else
    return nil  -- 列表为空，票已售罄
end


--   "couponId": 0,
--   "couponCode": "",
--   "couponName": "10元优惠券",
--   "couponType": 131,
--   "conditionMet": "满100减10",
--   "discountAmount": 10.0,
--   "discountRate": 0.0,
--   "startTime": "2025-3-19 16:57:00",
--   "endTime": "2025-3-19 16:58:00",
--   "totalQuantity": 10,
--   "limitPerPerson": 1,
--   "validStartTime": "2025-3-20 10:00:00",
--   "validEndTime": "2025-3-21 10:00:00",
--   "status": 136,
--   "merchantId": 1